<template>
	<Layout :bstyle="{background:'white'}">
		<template #title>我的分销</template>
		<ScrollRefresher @refresh="refresh" @tolower="tolower">
			<view v-for="item of list" :key="item.brokerageUserId" class="iflex aic fill item">
				<view class="iflex aic fill item__box">
					<image :src="item.avatar"></image>
					<view class="flex column jcsb info">
						<view class="info__nickname">{{item.nickname}}</view>
						<view class="info__time">{{item.bindUserTime}}</view>
					</view>
				</view>
			</view>
		</ScrollRefresher>
	</Layout>
</template>

<script setup lang="ts">
	import { ref } from 'vue';
	import { onLoad } from '@dcloudio/uni-app';
	import { getBrokerageUserList } from '@/apis/auth';
	import { useGetDataPaging } from '@/hooks/paging';
	const { list, refresh, tolower } = useGetDataPaging({
		api: getBrokerageUserList
	})
	onLoad(() => {
		refresh();
	});
</script>

<style lang="scss" scoped>
	.item {
		padding: 0 32rpx;

		&__box {
			padding: 32rpx 0 40rpx 0;
			border-bottom: 1px solid #F4F7FB;

			image {
				width: 100rpx;
				height: 100rpx;
				border-radius: 34rpx;
			}

			.info {
				padding-left: 28rpx;
				height: 100rpx;

				&__nickname {
					color: #000000;
					font-size: 32rpx;
					font-weight: 400;
				}

				&__time {
					color: #737d91;
					font-size: 24rpx;
					font-weight: 400;
				}
			}
		}
	}
</style>